1. Field of the Invention
The present invention relates to disk drives. More particularly, the present invention relates to a method and system for preventing data loss from an off-track write condition in a disk drive by rewriting data buffered from an adjacent track.
2. Background Information
In a magnetic disk drive, data is typically recorded on a disk surface in concentric tracks which are partitioned into data blocks referred to as data sectors. In order to write or read data to from a particular data sector, a servo control system within the disk drive performs a seek operation to position a head over a target track, and then a tracking operation to maintain the head over a centerline of the target track while writing or reading data. During the seek operation, the servo control system controls a voice coil motor (VCM) so as to rotate an actuator arm to which the head is connected until the head is positioned radially over the target track. The servo control system then makes fine adjustments to the VCM to make the head maintain centerline tracking. To facilitate positioning the head, embedded servo sectors comprising head positioning information are typically recorded at equally-spaced distances around each track of the disk. For example, a servo sector may comprise a track address which identifies the current track location of the head for coarse positioning while seeking to the target track, as well as servo bursts recorded at precise intervals and offsets from a track""s centerline which provide a centerline offset for use in tracking.
Various system dynamics may cause an off-track write condition during a write operation wherein the head""s position relative to the track""s centerline exceeds a prescribed threshold during tracking. For instance, an external, mechanical shock to the disk drive can induce a corresponding acceleration of the actuator arm which moves the arm away from the track center.
When an off-track write condition is detected a conventional response is simply to abort the current write operation, wait for the disk to rotate until the head is again over the beginning of the target data sector, and then rewrite the data sector. However, this recovery technique does not take into account the adverse impact that an off-track write condition may have on the data sectors of adjacent tracks. That is, during an off-track write condition the head may cross over into an adjacent track and corrupt the data recorded in an adjacent data sector.
U.S. Pat. No. 5,909,334 (Barr et al.) (the ""334 patent) discloses a method and apparatus for verifying that data written on magnetic disk media can be successfully recovered in subsequent read operations and ensuring that the data to be written is held by a buffer until a read-verify operation indicates that the buffer space storing the data may be relinquished for new operations. The ""334 patent is hereby incorporated by reference in its entirety. According to the ""334 patent, the drive tests a data block, which includes redundancy data, read from the disk to determine if the data is within correctable limits. If the data is outside correctable limits, the data is re-written until it is within correctable limits or until a predetermined count limit is reached.
There is a need for an improved technique for preventing data loss from an off-track write condition in a disk drive which results in a head crossing over and corrupting data in an adjacent track.
A method and system are described for preventing data loss from an off-track write condition in a disk drive. In accordance with exemplary embodiments of the present invention, the disk drive comprises a disk surface comprising a first track and a second track adjacent to the first track, and a head for writing data to and reading data from the first and second tracks. The method of recovering from the off-track write condition comprises the steps of receiving a write command to write a first series of data blocks on the first track. Before writing the first series of data blocks, a second series of data blocks stored in the second track is read and stored in a data buffer. Writing the first series of data blocks on the first track is initiated, and while writing the first series of data blocks, detecting a signal indicating the head may have wandered toward the second track and in response to the signal: aborting the writing of the first series of data blocks; repositioning the head on the first track and performing track following; writing at least a portion of the first series of data blocks to the first track; and writing at least a portion of the second series of data blocks, stored in the data buffer, to the second track.
The present invention may also be regarded as a disk drive comprising a disk surface comprising a first track and a second track adjacent to the first track, and a head for writing and reading data stored in the first and second tracks, wherein the head writes at least part of a first data block to the first track. The disk drives comprises a read/write channel for encoding data written to the disk surface during a write operation and for detecting a read signal emanating from the head during a read operation, a servo control system for generating control signals to position the head over the disk surface, an off-track write condition detector for detecting an off-track write condition, and a data buffer for storing a data block written to the disk. The disk drive further comprises a program memory for storing steps of a procedure for preventing data loss from an off-track write condition detected by the off-track write condition detector, and a means, coupled to the read/write channel, the servo control system and the off-track write condition detector, for executing the steps of the data loss prevention procedure stored in the program memory in response to the detected off-track write condition.
The data loss prevention procedure includes the steps of: receiving a write command to write a first series of data blocks on the first track; before writing the first series of data blocks, reading a second series of data blocks stored in the second track and storing the second series of data blocks in a data buffer; initiating writing of the first series of data blocks on the first track and while writing the first series of data blocks, detecting a signal indicating the head may have wandered toward the second track and in response to the signal: aborting the writing of the first series of data blocks; repositioning the head on the first track and performing track following; writing at least a portion of the first series of data blocks to the first track; and writing at least a portion of the second series of data blocks, stored in the data buffer, to the second track.